package com.hongyi.system.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hongyi.common.mybatis.annotation.DataColumn;
import com.hongyi.common.mybatis.annotation.DataPermission;
import com.hongyi.system.domain.SysUserNotice;
import com.hongyi.common.mybatis.mapper.BaseMapperExtend;
import com.hongyi.system.domain.dto.SysUserNoticeDto;
import com.hongyi.system.domain.vo.SysUserNoticeVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 用户消息关联Mapper接口
 *
 * @author DingHao
 * @date 2025-01-24 13:13:15
 */
@Repository
public interface SystemUserNoticeMapper extends BaseMapperExtend<SysUserNotice, SysUserNoticeVo> {

    /**
     * 查询当前用户未读通知列表
     *
     * @param userId 用户id
     * @return 前3个未读通知列表
     */
    List<SysUserNoticeVo> selectMyNoticeList(@Param("userId")Long userId, @Param("readStatus")String readStatus);

    /**
     * 查询用户消息关联分页列表
     *
     * @param pageQuery 分页数据
     * @param systemUserNoticeDto 查询条件
     * @return 用户消息关联集合
     */
//    @DataPermission({
//            @DataColumn(key = "userName", value = "t1.user_id")
//    })
    Page<SysUserNoticeVo> selectMyNoticeListPage(@Param("systemUserNoticeDto") SysUserNoticeDto systemUserNoticeDto,@Param("pageQuery") Page<SysUserNoticeVo> pageQuery);


    SysUserNoticeVo selectMyNoticeById(Long id);
}
